3.674 \(\int \frac {(a+i a \tan (e+f x)) (A+B \tan (e+f x))}{(c-i c \tan (e+f x))^4} \, dx\)

Optimal. Leaf size=57 \[ -\frac {a (B+i A)}{4 c^4 f (\tan (e+f x)+i)^4}-\frac {i a B}{3 c^4 f (\tan (e+f x)+i)^3} \]

[Out]

-1/4*a*(I*A+B)/c^4/f/(tan(f*x+e)+I)^4-1/3*I*a*B/c^4/f/(tan(f*x+e)+I)^3

________________________________________________________________________________________

Rubi [A]  time = 0.09, antiderivative size = 57, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 39, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.051, Rules used = {3588, 43} \[ -\frac {a (B+i A)}{4 c^4 f (\tan (e+f x)+i)^4}-\frac {i a B}{3 c^4 f (\tan (e+f x)+i)^3} \]

Antiderivative was successfully verified.

[In]

Int[((a + I*a*Tan[e + f*x])*(A + B*Tan[e + f*x]))/(c - I*c*Tan[e + f*x])^4,x]

[Out]

-(a*(I*A + B))/(4*c^4*f*(I + Tan[e + f*x])^4) - ((I/3)*a*B)/(c^4*f*(I + Tan[e + f*x])^3)

Rule 43

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 3588

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_) + (d_.)*tan[(e_
.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[(a*c)/f, Subst[Int[(a + b*x)^(m - 1)*(c + d*x)^(n - 1)*(A + B*x), x
], x, Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0]

Rubi steps

\begin {align*} \int \frac {(a+i a \tan (e+f x)) (A+B \tan (e+f x))}{(c-i c \tan (e+f x))^4} \, dx &=\frac {(a c) \operatorname {Subst}\left (\int \frac {A+B x}{(c-i c x)^5} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(a c) \operatorname {Subst}\left (\int \left (\frac {i A+B}{c^5 (i+x)^5}+\frac {i B}{c^5 (i+x)^4}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac {a (i A+B)}{4 c^4 f (i+\tan (e+f x))^4}-\frac {i a B}{3 c^4 f (i+\tan (e+f x))^3}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 1.58, size = 97, normalized size = 1.70 \[ \frac {a (\cos (5 (e+f x))+i \sin (5 (e+f x))) (-(3 A+5 i B) (2 \sin (e+f x)+3 \sin (3 (e+f x)))+2 (B-15 i A) \cos (e+f x)+3 (3 B-5 i A) \cos (3 (e+f x)))}{192 c^4 f} \]

Antiderivative was successfully verified.

[In]

Integrate[((a + I*a*Tan[e + f*x])*(A + B*Tan[e + f*x]))/(c - I*c*Tan[e + f*x])^4,x]

[Out]

(a*(2*((-15*I)*A + B)*Cos[e + f*x] + 3*((-5*I)*A + 3*B)*Cos[3*(e + f*x)] - (3*A + (5*I)*B)*(2*Sin[e + f*x] + 3
*Sin[3*(e + f*x)]))*(Cos[5*(e + f*x)] + I*Sin[5*(e + f*x)]))/(192*c^4*f)

________________________________________________________________________________________

fricas [A]  time = 0.66, size = 81, normalized size = 1.42 \[ \frac {{\left (-3 i \, A - 3 \, B\right )} a e^{\left (8 i \, f x + 8 i \, e\right )} + {\left (-12 i \, A - 4 \, B\right )} a e^{\left (6 i \, f x + 6 i \, e\right )} + {\left (-18 i \, A + 6 \, B\right )} a e^{\left (4 i \, f x + 4 i \, e\right )} + {\left (-12 i \, A + 12 \, B\right )} a e^{\left (2 i \, f x + 2 i \, e\right )}}{192 \, c^{4} f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))*(A+B*tan(f*x+e))/(c-I*c*tan(f*x+e))^4,x, algorithm="fricas")

[Out]

1/192*((-3*I*A - 3*B)*a*e^(8*I*f*x + 8*I*e) + (-12*I*A - 4*B)*a*e^(6*I*f*x + 6*I*e) + (-18*I*A + 6*B)*a*e^(4*I
*f*x + 4*I*e) + (-12*I*A + 12*B)*a*e^(2*I*f*x + 2*I*e))/(c^4*f)

________________________________________________________________________________________

giac [B]  time = 2.68, size = 213, normalized size = 3.74 \[ -\frac {2 \, {\left (3 \, A a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{7} + 9 i \, A a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{6} - 3 \, B a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{6} - 21 \, A a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} - 4 i \, B a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} - 24 i \, A a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} + 8 \, B a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} + 21 \, A a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 4 i \, B a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 9 i \, A a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 3 \, B a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 3 \, A a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )}}{3 \, c^{4} f {\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + i\right )}^{8}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))*(A+B*tan(f*x+e))/(c-I*c*tan(f*x+e))^4,x, algorithm="giac")

[Out]

-2/3*(3*A*a*tan(1/2*f*x + 1/2*e)^7 + 9*I*A*a*tan(1/2*f*x + 1/2*e)^6 - 3*B*a*tan(1/2*f*x + 1/2*e)^6 - 21*A*a*ta
n(1/2*f*x + 1/2*e)^5 - 4*I*B*a*tan(1/2*f*x + 1/2*e)^5 - 24*I*A*a*tan(1/2*f*x + 1/2*e)^4 + 8*B*a*tan(1/2*f*x +
1/2*e)^4 + 21*A*a*tan(1/2*f*x + 1/2*e)^3 + 4*I*B*a*tan(1/2*f*x + 1/2*e)^3 + 9*I*A*a*tan(1/2*f*x + 1/2*e)^2 - 3
*B*a*tan(1/2*f*x + 1/2*e)^2 - 3*A*a*tan(1/2*f*x + 1/2*e))/(c^4*f*(tan(1/2*f*x + 1/2*e) + I)^8)

________________________________________________________________________________________

maple [A]  time = 0.23, size = 44, normalized size = 0.77 \[ \frac {a \left (-\frac {i A +B}{4 \left (\tan \left (f x +e \right )+i\right )^{4}}-\frac {i B}{3 \left (\tan \left (f x +e \right )+i\right )^{3}}\right )}{f \,c^{4}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+I*a*tan(f*x+e))*(A+B*tan(f*x+e))/(c-I*c*tan(f*x+e))^4,x)

[Out]

1/f*a/c^4*(-1/4*(I*A+B)/(tan(f*x+e)+I)^4-1/3*I*B/(tan(f*x+e)+I)^3)

________________________________________________________________________________________

maxima [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: RuntimeError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))*(A+B*tan(f*x+e))/(c-I*c*tan(f*x+e))^4,x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: Error executing code in Maxima: expt: undefined: 0 to a negative e
xponent.

________________________________________________________________________________________

mupad [B]  time = 8.67, size = 73, normalized size = 1.28 \[ -\frac {\frac {a\,\left (-B+A\,3{}\mathrm {i}\right )}{12}+\frac {B\,a\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}}{3}}{c^4\,f\,\left ({\mathrm {tan}\left (e+f\,x\right )}^4+{\mathrm {tan}\left (e+f\,x\right )}^3\,4{}\mathrm {i}-6\,{\mathrm {tan}\left (e+f\,x\right )}^2-\mathrm {tan}\left (e+f\,x\right )\,4{}\mathrm {i}+1\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((A + B*tan(e + f*x))*(a + a*tan(e + f*x)*1i))/(c - c*tan(e + f*x)*1i)^4,x)

[Out]

-((a*(A*3i - B))/12 + (B*a*tan(e + f*x)*1i)/3)/(c^4*f*(tan(e + f*x)^3*4i - 6*tan(e + f*x)^2 - tan(e + f*x)*4i
+ tan(e + f*x)^4 + 1))

________________________________________________________________________________________

sympy [B]  time = 0.64, size = 306, normalized size = 5.37 \[ \begin {cases} \frac {\left (- 98304 i A a c^{12} f^{3} e^{2 i e} + 98304 B a c^{12} f^{3} e^{2 i e}\right ) e^{2 i f x} + \left (- 147456 i A a c^{12} f^{3} e^{4 i e} + 49152 B a c^{12} f^{3} e^{4 i e}\right ) e^{4 i f x} + \left (- 98304 i A a c^{12} f^{3} e^{6 i e} - 32768 B a c^{12} f^{3} e^{6 i e}\right ) e^{6 i f x} + \left (- 24576 i A a c^{12} f^{3} e^{8 i e} - 24576 B a c^{12} f^{3} e^{8 i e}\right ) e^{8 i f x}}{1572864 c^{16} f^{4}} & \text {for}\: 1572864 c^{16} f^{4} \neq 0 \\\frac {x \left (A a e^{8 i e} + 3 A a e^{6 i e} + 3 A a e^{4 i e} + A a e^{2 i e} - i B a e^{8 i e} - i B a e^{6 i e} + i B a e^{4 i e} + i B a e^{2 i e}\right )}{8 c^{4}} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))*(A+B*tan(f*x+e))/(c-I*c*tan(f*x+e))**4,x)

[Out]

Piecewise((((-98304*I*A*a*c**12*f**3*exp(2*I*e) + 98304*B*a*c**12*f**3*exp(2*I*e))*exp(2*I*f*x) + (-147456*I*A
*a*c**12*f**3*exp(4*I*e) + 49152*B*a*c**12*f**3*exp(4*I*e))*exp(4*I*f*x) + (-98304*I*A*a*c**12*f**3*exp(6*I*e)
 - 32768*B*a*c**12*f**3*exp(6*I*e))*exp(6*I*f*x) + (-24576*I*A*a*c**12*f**3*exp(8*I*e) - 24576*B*a*c**12*f**3*
exp(8*I*e))*exp(8*I*f*x))/(1572864*c**16*f**4), Ne(1572864*c**16*f**4, 0)), (x*(A*a*exp(8*I*e) + 3*A*a*exp(6*I
*e) + 3*A*a*exp(4*I*e) + A*a*exp(2*I*e) - I*B*a*exp(8*I*e) - I*B*a*exp(6*I*e) + I*B*a*exp(4*I*e) + I*B*a*exp(2
*I*e))/(8*c**4), True))

________________________________________________________________________________________